import cv2
image=cv2.imread('sobel.png',cv2.IMREAD_GRAYSCALE)
Sobelx=cv2.Sobel(image,cv2.CV_64F,1,0)
Sobely=cv2.Sobel(image,cv2.CV_64F,0,1)
grad_x=cv2.convertScaleAbs(Sobelx)
grad_y=cv2.convertScaleAbs(Sobely)
Sobelxy=cv2.addWeighted(grad_x,0.5,grad_y,0.5,0)
cv2.imshow("Input",image)
cv2.imshow('sobel_x',Sobelx)
cv2.imshow('sobelasxy',grad_x)
cv2.imshow('sobelabsx',grad_y)
cv2.imshow('sobel_y',Sobely)
cv2.imshow('Sobel',Sobelxy)
cv2.waitKey()
cv2.destroyAllWindows()